<template>
  <div>
    <img
      src="https://img2.baidu.com/it/u=617579813,2960860841&fm=253&app=120&size=w931&n=0&f=JPEG&fmt=auto?sec=1669914000&t=3abb86021b292ebc1b712b56348a7a82"
      alt=""
      v-show="add"
    />
    <button @click="fn">点击以后显示和隐藏</button>

    <!-- 点击按钮显示或隐藏图片 -->
  </div>
</template>

<script>
export default {
  data() {
    return {
      add: true,
    }
  },

  methods: {
    fn() {
      this.add = !this.add
    },
  },
}
</script>

<style scoped></style>
